package com.dao.Fxy;

import java.sql.Connection;
import java.sql.DriverManager;

public class Mysql {
    private static String driver = "com.mysql.cj.jdbc.Driver";
    private static String url = "jdbc:mysql://localhost:3306/project2?serverTimezone=UTC";
    private static String user = "root";
    private static String pass = "root";
    public static Connection getConnection(){
        try {
            Class.forName(driver);
            return DriverManager.getConnection(url,user,pass);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}